class HomeTabAreaDetailObj {
  String areaName;
  int carCount;
  List<HomeTabAreaDetailObj> child;
  int nodeId;
  int personCount;

  bool isShow;
  bool isExpand;
  int level;
  bool isSelect;

  HomeTabAreaDetailObj(
      {this.areaName,
      this.carCount,
      this.child,
      this.nodeId,
      this.personCount,
      this.isShow = false,
      this.isExpand = false,
      this.level,
      this.isSelect = false});

  factory HomeTabAreaDetailObj.fromJson(Map<String, dynamic> json) {
    return HomeTabAreaDetailObj(
      areaName: json['areaName'],
      carCount: json['carCount'],
      child: json['child'] != null
          ? (json['child'] as List)
              .map((i) => HomeTabAreaDetailObj.fromJson(i))
              .toList()
          : null,
      nodeId: json['nodeId'],
      personCount: json['personCount'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['areaName'] = this.areaName;
    data['carCount'] = this.carCount;
    data['nodeId'] = this.nodeId;
    data['personCount'] = this.personCount;
    if (this.child != null) {
      data['child'] = this.child.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
